<!DOCTYPE html>
<html>

	<head lang="en">
		<meta charset="UTF-8">
		<title>课工场论坛列表</title>
		<link href="css/bbs.css" rel="stylesheet">
		<script type="text/javascript">
			function showPost() {
				document.getElementById("post").style.display = "block";
			}

			function doPost() {
				var u=document.getElementById("postList");
				var l=document.createElement("li");
				u.appendChild(l);
				var d1=document.createElement("div");
				l.appendChild(d1);
				var img=document.createElement("img");
				img.setAttribute("src","images/tou0"+parseInt(Math.random()*4+1)+".jpg");
				d1.appendChild(img);
				var h1=document.createElement("h1");
				h1.innerHTML=document.getElementById("title").value;
				l.appendChild(h1);
				 
				var bankuai= document.getElementById("topic").options[document.getElementById("topic").selectedIndex].text;
				var p=document.createElement("p");
				l.appendChild(p);//
				var s1=document.createElement("span");
				s1.innerHTML=bankuai;
				p.appendChild(s1);
				var s2=document.createElement("span");
				s2.innerHTML=new Date().toLocaleString();
				p.appendChild(s2);
				
				document.getElementById("post").style.display = "none";
			}
		</script>
	</head>

	<body>
		<div class="bbs">
			<header><span onclick="showPost()">我要发帖</span></header>
			<section>
				<ul id="postList">
					<li>
						<div><img src="images/tou02.jpg"></div>
						<h1>sdfsd</h1>
						<p><span>版块：电子书籍</span><span>发表时间：2018-12-13 12:18</span></p>
					</li>
					<li>
						<div><img src="images/tou02.jpg"></div>
						<h1>sdfsd</h1>
						<p><span>版块：电子书籍</span><span>发表时间：2018-12-13 12:18</span></p>
					</li>
				</ul>
			</section>
			<div class="post" id="post">
				<input id="title" class="title" placeholder="请输入标题（1-50个字符）"> 所属版块：
				<select id="topic">
					<option>请选择版块</option>
					<option>电子书籍</option>
					<option>新课来了</option>
					<option>新手报到</option>
					<option>职业规划</option>
				</select>
				<textarea class="content"></textarea>
				<input class="btn" onclick="doPost()" value="发布">
			</div>
		</div>
	</body>

</html>